/**
* 
* ====================================================================
*
* @author apov <apov@ymail.com>
*/ 
#pragma once

#include <BaseDefine.h>
#include <KeyValueManager.h>
#include <TickSaver.h>

class NotifyManager{
	enum{
		DEF_LOAD_TICK=			DEF_ONE_MIN_MSEC * 5,
	};

public:
	struct Notify{
		size_t idx;
		size_t sec;
		size_t area;
		size_t type;
		std::string contents;
		TickSaver tick_saver;
	};

	bool load( char* file_name, size_t current_sec );
	Notify* get_fire_notify( size_t current_sec );

	NotifyManager();
	virtual ~NotifyManager();

protected:

private:
	typedef KeyValueManager< size_t, Notify* > Notifys;
	
	void update_notify( Notify& nfy, size_t current_sec );

	Notifys notifys_;
	TickSaver tick_;
};
